package com.socialrss.accounts.factoryobject;

import android.content.ContentValues;
import android.database.Cursor;

import com.socialrss.accounts.AbstractNotification;
import com.socialrss.accounts.InstagramNotification;
import com.socialrss.accounts.TwitterNotification;
import com.socialrss.accounts.dbinterfaces.IInstagramNotificationTable;
import com.socialrss.accounts.dbinterfaces.ITwitterNotificationTable;

public class TwitterNotificationFactory extends AbstractNotificationFactory {
	private int userid;
	public TwitterNotificationFactory(int userid){
		this.userid= userid;
	}
	@Override
	public AbstractNotification turnToObject(Cursor cur) {
		TwitterNotification value = new TwitterNotification();
		value.setId(cur.getInt(0));
		value.setTextContent(cur.getString(1));
		value.setLink(cur.getString(2));
		value.setDate(cur.getInt(3));
		return value;
	}

	@Override
	public ContentValues turnToDBInput(AbstractNotification temp) {
		ContentValues values = new ContentValues();
		values.put(ITwitterNotificationTable.USER_ID, userid);
		values.put(ITwitterNotificationTable.TWIT_CONTENT, temp.getTextContent());
		values.put(ITwitterNotificationTable.TWIT_LINK, temp.getLink());
		values.put(ITwitterNotificationTable.TWIT_DATE, temp.getDate());
		
		return values;
	}

}
